package main

import "fmt"

type person struct {
	Name string `json:"name"`
	Age  int
}
type address struct {
	province string
	city     string
}

func (p *person) String() string {
	return fmt.Sprintf("the name is %s,age is %d", p.Name, p.Age)
}

func (addr address) String() string {
	return fmt.Sprintf("the addr is %s%s", addr.province, addr.city)
}

func NewPerson(name string) *person {
	return &person{Name: name}
}
func main() {
	p1 := NewPerson("张三")

	var s fmt.Stringer
	s = p1
	p2 := s.(*person)
	fmt.Println(p2)
}
